import { ConstValues } from './../projectIndicators.config';

export function setTableTpl() {
    let _this = this;
    const tableTpl = [
        {
            title: "序号", dataIndex: "index", key: "index", width: '4%',
            render(text, record, index) {
                return <span>{index + 1}</span>
            }
        },
        { title: "项目编码", dataIndex: "projectCode", key: "projectCode" },
        { title: "项目名称", dataIndex: "projectName", key: "projectName", width: '10%' },
        { title: "项目组织", dataIndex: "orgName", key: "orgName" },
        { title: "停工日期", dataIndex: "stopDate", key: "stopDate", width: '10%' },
        { title: "停工天数(天)", dataIndex: "workstopdays", key: "workstopdays" },
        { title: "预计复工日期", dataIndex: "preresumeDate", key: "preresumeDate", width: '10%' },
        { title: "单据状态", dataIndex: "strBillstatus", key: "strBillstatus", width: '10%' },
        { title: "制单人", dataIndex: "creatorName", key: "creatorName", width: '10%' },
        { title: "制单日期", dataIndex: "creationtime", key: "creationtime", width: '10%' },
        {
            title: "操作", dataIndex: "billstatus", key: "billstatus",
            render(text, record, index) {
                return (
                    (text === 7 || text === 5) ? <span className="ygc-stopwork-list-table-cell"
                        onClick={() => {
                            _this.props.passreject.initPassRejectModal({ record, index, page: 'list', primaryKey: ConstValues.Primarykey });
                        }}
                    >审批</span> : ''
                )
            }
        }
    ];
    return tableTpl
}
